﻿using Microsoft.Extensions.Caching.Memory;
using System.ServiceModel;

namespace KingerRobot.MexicoSailunWMS.SpiService;
class Caching
{
    //public static T GetData<T>(string cacheKey, int expSecond, Func<T> getData)
    //{
        //return XCache.Caching.Cache.Get<T>(cacheKey);
        //var cache = null;// XCache.Caching.Cache.Get<T>(cacheKey);
        //if (cache != null)
        //{
        //    return cache;
        //}
        //try
        //{
        //    cache = getData();
        //}
        //catch (Exception ex)
        //{
        //    return default(T);
        //}
        //if (cache == null)
        //{
        //    return default(T);
        //}
        ////XCache.Caching.Cache.Add(new XCache.CacheData<T>()
        ////{
        ////    AbsoluteExpiration = expSecond * 1000,
        ////    Key = cacheKey,
        ////    Value = cache,
        ////});
        //return cache;
    //}
    public static void Remove(string cacheKey)
    {
       // XCache.Caching.Cache.Remove(cacheKey);
    }
}
